package com.mofang.ticketing.user.mapping.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

import java.io.Serializable;

/**
 * 用户和角色
 *
 * @TableName sys_user_role
 */
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "sys_user_role")
@Data
public class SysUserRoleDO implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id")
    private Long id;

    /**
     * 所属组织 1=平台、2=商户、3=项目成员
     */
    @TableField(value = "belong")
    private Integer belong;

    /**
     * 商户ID
     */
    @TableField(value = "merchant_id")
    private Long merchantId;

    /**
     * 用户ID
     */
    @TableField(value = "user_id")
    private Long userId;

    /**
     * 角色ID
     */
    @TableField(value = "role_id")
    private Long roleId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    public SysUserRoleDO(Integer belong, Long merchantId, Long userId, Long roleId) {
        this.belong = belong;
        this.merchantId = merchantId;
        this.userId = userId;
        this.roleId = roleId;
    }
}